package com.chenjian.codingstylespringsecurity.controller;

import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenjian
 * @date 2018/12/3 12:59
 */
@RestController
public class IndexController {

    @GetMapping(value = "/hello")
    public String getHello() {
        return "Hello";
    }

    @GetMapping(value = "/hello2")
    public String getHello2(@RequestParam(required = false, name = "id", defaultValue = "1") String id, @PageableDefault Pageable pageable) {
        System.out.println(id);
        System.out.println(pageable);
        return id;
    }
}
